package controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import services.AdministratorService;

@Controller
@RequestMapping("/rating")
public class RatingController extends AbstractController{

	// Constructors -----------------------------------------------------------

		public RatingController() {
			super();
		}
		
		@Autowired
		private AdministratorService administratorService;

		// Compute ---------------------------------------------------------------	
		
		@RequestMapping("/administrator/compute")
		public ModelAndView ratingAdministrator() {
			ModelAndView result;

			
			result = new ModelAndView("welcome/index");

			administratorService.computeRating();
			
			result.addObject("message", "compute.sucess");
			return result;
			
		}
}
